FROM ubuntu:24.04

WORKDIR /tmp

RUN apt-get update -y && apt-get install wget make gcc pkg-config libjemalloc-dev -y && mkdir -p /etc/redis

# 安装redis
RUN wget https://github.com/redis/redis/archive/7.2.4.tar.gz && tar -zxvf ./7.2.4.tar.gz && cd ./redis-7.2.4/deps && make hiredis jemalloc linenoise lua && \
     cd ./hdr_histogram && make && cd ../ && \
     cd ./fpconv && make && cd ../ && \
     make

# 拷贝redis配置
COPY ./conf/redis.conf /etc/redis/redis.conf

# 启动redis
RUN cd /tmp/redis-7.2.4/src/ && ./redis-server /etc/redis/redis.conf